import 'package:boss/textStyle/text_style.dart';
import 'package:boss/ui/widget/custom_list_title.dart';
import 'package:boss/ui/widget/label_button.dart';
import 'package:flutter/material.dart';

class TitleLabelBtn extends StatelessWidget {
  final String title;
  final bool isRequired;
  final String label;
  final VoidCallback onTap;

  const TitleLabelBtn({
    Key key,
    @required this.title,
    @required this.label,
    this.onTap,
    this.isRequired = false,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return CustomListTitle(
      title: RichText(
        text: TextSpan(
          text: title,
          style: TextStyleConstant().normal_1_28,
          children: [
            if (isRequired)
              TextSpan(
                text: '*',
                style: TextStyleConstant().origin_28,
              )
          ],
        ),
      ),
      trailing: LabelButton(
        title: label,
        onTap: onTap,
      ),
    );
  }
}
